//
//  OSHomeVC.m
//  ZKPayApp
//
//  Created by 凯朱 on 2024/10/29.
//

#import "OSMineVC.h"
#import "OSMineView.h"

@interface OSMineVC (){
    
}
@property (nonatomic, strong)OSMineView *headView;
@property (nonatomic, strong)UITableView *tableView;
@end

@implementation OSMineVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.isHidenNaviBar = YES;
    self.view.backgroundColor = kClearColor;
    [self.view addSubview:self.tableView];
    _headView = [OSMineView viewFromXIB];
    CGFloat height = 250+70*6;
    _headView.frame = CGRectMake(0, 0, KScreenWidth,MAX(height, kScreenHeight-SafeAreaBottomHeight-50));
    self.tableView.tableHeaderView = _headView;
    [self loginStatusChange];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginStatusChange) name:@"loginStatusChange" object:nil];
}

-(void)loginStatusChange{
    if (kIsTourst) {
        _headView.nameLbl.text = kLocalString(@"未登录");
    }else{
        _headView.nameLbl.text = kUserInfo.name;
    }
}

#pragma mark - ================<懒加载>===============
-(UITableView *)tableView{
    if (_tableView == nil) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0,kScreenWidth,self.view.height) style:UITableViewStyleGrouped];
        _tableView.backgroundColor = kClearColor;
        _tableView.showsVerticalScrollIndicator = NO;
    }
    return _tableView;
}



@end
